package com.example.demo.entity;

import java.util.Date;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.Transient;

import org.springframework.format.annotation.DateTimeFormat;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;

@Entity
public class MoneyCompany2 {
	private Integer id;
	private MoneyCompany money;
	private Float monkeyBackMoney; //金融返利点数
	private Date beginDate;//开始时间
	private Date endDate;//结束时间
	
	@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	public Date getBeginDate() {
		return beginDate;
	}
	public void setBeginDate(Date beginDate) {
		this.beginDate = beginDate;
	}
	
	
	@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	public Date getEndDate() {
		return endDate;
	}
	public void setEndDate(Date endDate) {
		this.endDate = endDate;
	}
	
	
	
	@Id
	@GeneratedValue
	@JsonIgnore
	public Integer getId() {
		return id;
	}
	public void setId(Integer id) {
		this.id = id;
	}
	
	
	@ManyToOne
	public MoneyCompany getMoney() {
		return money;
	}
	public void setMoney(MoneyCompany money) {
		this.money = money;
	}
	
	
	public Float getMonkeyBackMoney() {
		return monkeyBackMoney;
	}
	public void setMonkeyBackMoney(Float monkeyBackMoney) {
		this.monkeyBackMoney = monkeyBackMoney;
	}
	
	@Transient
	public Integer getMoneyId() {
		return money==null?null:money.getId();
	}
	
}
